//package org.hxd.config;
//
//import org.hxd.pojo.User_inf;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.HandlerInterceptor;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
////拦截器的使用
//
//public class LoginConfig implements HandlerInterceptor {
//
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//        User_inf user_inf = (User_inf) request.getSession().getAttribute("user_inf");
//        System.out.println("--------------------" + request.getRequestURI() + "-----------------------");
//        if(user_inf==null){
//            request.setAttribute("msg","请先登录！");
//            request.getRequestDispatcher("/index.jsp").forward(request, response);
//            return false;
//        }
//        return true;
//    }
//}
